/*
 ============================================================================
 Page	     : 384-385
 Name        : global.c
 Date	     : 20210406
 Author      : Hbue 18060333
 Copyright   : Your copyright notice
 Description : 使用外部变量
 ============================================================================
 */

#include <stdio.h>
int units = 0;		/* 外部变量 */
void critic(void);

int main(void)
{
	extern int units;	/* 可选的重复声明 */

	printf("How many pounds to a firkin of butter?\n");
	scanf("%d", &units);
	while(units != 56)
	{
		critic();
	}

	printf("You must have looked it up!\n");
	return 0;
}

void critic(void)
{
	/* 删除了可选的重复声明 */
	printf("No luck, my friend. Try again.\n");
	scanf("%d", &units);
}

